import {MessageBox} from 'element-ui';
export default {
  install (Vue,options) {
    Vue.prototype.confirm = function (data) {
      MessageBox.confirm(data.content, data.tips || "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
        center: true,
      })
        .then(() => {
          data.fn&&data.fn(data.id)
          // root.$message({
          //   type: "success",
          //   message: "删除成功!",
          //   fn:'confirmDelete'
          // });
        })
        .catch(() => {
          // root.$message({
          //type: "info",
          //message: "已取消删除",
          // });
        });
    }
  }
}